package com.sailfish.template.infra.feign.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author XIAXINYU3
 * @date 2021.11.9
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class IamProjectVO {
    @ApiModelProperty("id")
    private Long id;

    @ApiModelProperty("项目名")
    @NotEmpty(message = "project.name.empty")
    @Size(max = 40, min = 1, message = "project.name.size")
    @Pattern(regexp = "^[-—\\.\\w\\s\\u4e00-\\u9fa5]{1,40}$", message = "project.name.pattern")
    private String name;

    @ApiModelProperty("项目编码")
    @NotEmpty(message = "project.code.name")
    @Size(min = 1, max = 40, message = "project.code.size")
    @Pattern(regexp = "^[-—\\.\\w\\s\\u4e00-\\u9fa5]{1,40}$", message = "project.code.pattern")
    private String code;

    @ApiModelProperty("状态编码")
    private String statusCode;

    @ApiModelProperty("开始时间")
    private Date startTime;

    @ApiModelProperty("结束时间")
    private Date finishTime;

    @ApiModelProperty("顶级父项目id")
    private Long topId;

    @ApiModelProperty("父项目id")
    private Long parentId;

    @ApiModelProperty("父项目")
    private IamProjectVO parent;

    @ApiModelProperty("项目层级")
    private Integer level;

    @ApiModelProperty("项目描述")
    private String description;

    @ApiModelProperty("组织编号")
    private Long organizationId;

    @ApiModelProperty("组织名称")
    private String organizationName;

    @ApiModelProperty("是否启用")
    private Boolean isEnabled;

    @ApiModelProperty("兼容老行云，新行云勿用此字段")
    private Boolean enabled;

    @ApiModelProperty("项目图标url")
    private String imageUrl;

    @ApiModelProperty("")
    private Long objectVersionNumber;

    @ApiModelProperty("创建人id")
    private Long createdBy;

    @ApiModelProperty("创建日期")
    private Date creationDate;

    @ApiModelProperty("修改人id")
    private Long lastUpdatedBy;

    @ApiModelProperty("修改人日志")
    private Date lastUpdateDate;

    @ApiModelProperty("项目类型")
    private String type;

    @Deprecated
    private String typeName;

    @ApiModelProperty("项目类别：agile(敏捷项目),program(普通项目组),analytical(分析型项目群)")
    @NotEmpty(message = "project.category.empty")
    private String category;

    @ApiModelProperty("公司注册项目状态：init(初始化),finish(完成)")
    private String status;

    private Long userId;

    @ApiModelProperty("用户姓名")
    private String realName;

    @ApiModelProperty("仅公司注册使用，其他地方无需处理，存放的是admin 账号id")
    private Long isCompanyRegister;
}
